{{ header }}{{ column_left }}
<div id="content">
    <div class="page-header">
        <div class="container-fluid">
            <div class="pull-right">
                <button type="button" data-toggle="tooltip" title="{{ button_filter }}"
                        onclick="$('#filter-order').toggleClass('hidden-sm hidden-xs');"
                        class="btn btn-default hidden-md hidden-lg"><i class="fa fa-filter"></i></button>
                <button type="submit" id="button-shipping" form="form-order" formaction="{{ shipping }}"
                        formtarget="_blank" data-toggle="tooltip" title="{{ button_shipping_print }}"
                        class="btn btn-info"><i class="fa fa-truck"></i></button>
                <button type="submit" id="button-invoice" form="form-order" formaction="{{ invoice }}"
                        formtarget="_blank" data-toggle="tooltip" title="{{ button_invoice_print }}"
                        class="btn btn-info"><i class="fa fa-print"></i></button>
                <button type="submit" id="button-export" form="form-order" formaction="{{ export }}" formtarget="_blank"
                        data-toggle="tooltip" title="{{ button_invoice_print }}" class="btn btn-info"><i
                            class="fa ">导出</i></button>
                <a href="{{ add }}" data-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i
                            class="fa fa-plus"></i></a></div>
            <h1>{{ heading_title }}</h1>
            <ul class="breadcrumb">
                {% for breadcrumb in breadcrumbs %}
                    <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
                {% endfor %}
            </ul>
        </div>
    </div>
    <div class="container-fluid">{% if error_warning %}
            <div class="alert alert-danger alert-dismissible"><i
                        class="fa fa-exclamation-circle"></i> {{ error_warning }}
                <button type="button" class="close" data-dismiss="alert">&times;</button>
            </div>
        {% endif %}
        {% if success %}
            <div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> {{ success }}
                <button type="button" class="close" data-dismiss="alert">&times;</button>
            </div>
        {% endif %}
        <div class="row">
            <div id="filter-order" class="col-sm-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><i class="fa fa-filter"></i> {{ text_filter }}</h3>
                    </div>
                    <div class="panel-body change-form">
                        <div class="form-group">
                            <label class="control-label" for="input-order-id">{{ entry_order_id }}</label>
                            <input type="text" name="filter_order_id" value="{{ filter_order_id }}"
                                   placeholder="{{ entry_order_id }}" id="input-order-id" class="form-control"/>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="input-customer">{{ entry_customer }}</label>
                            <input type="text" name="filter_customer" value="{{ filter_customer }}"
                                   placeholder="{{ entry_customer }}" id="input-customer" class="form-control"/>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="input-order-status">{{ entry_order_status }}</label>
                            <select name="filter_order_status_id" id="input-order-status" class="form-control">
                                <option value=""></option>

                                {% if filter_order_status_id == '0' %}

                                    <option value="0" selected="selected">{{ text_missing }}</option>

                                {% else %}

                                    <option value="0">{{ text_missing }}</option>

                                {% endif %}
                                {% for order_status in order_statuses %}
                                    {% if order_status.order_status_id == filter_order_status_id %}

                                        <option value="{{ order_status.order_status_id }}"
                                                selected="selected">{{ order_status.name }}</option>

                                    {% else %}

                                        <option value="{{ order_status.order_status_id }}">{{ order_status.name }}</option>

                                    {% endif %}
                                {% endfor %}

                            </select>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="input-total">{{ entry_total }}</label>
                            <input type="text" name="filter_total" value="{{ filter_total }}"
                                   placeholder="{{ entry_total }}" id="input-total" class="form-control"/>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="input-telephone">{{ '电话' }}</label>
                            <input type="text" name="telephone" value="{{ telephone }}" placeholder="{{ '电话' }}"
                                   id="input-telephone" class="form-control"/>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="input-date-added">{{ entry_date_added }}</label>
                            <div class="input-group date">
                                <input type="text" name="filter_date_added" value="{{ filter_date_added }}"
                                       placeholder="{{ entry_date_added }}" data-date-format="YYYY-MM-DD"
                                       id="input-date-added" class="form-control"/>
                                <span class="input-group-btn">
              <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
              </span></div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="input-date-modified">{{ entry_date_modified }}</label>
                            <div class="input-group date">
                                <input type="text" name="filter_date_modified" value="{{ filter_date_modified }}"
                                       placeholder="{{ entry_date_modified }}" data-date-format="YYYY-MM-DD"
                                       id="input-date-modified" class="form-control"/>
                                <span class="input-group-btn">
              <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
              </span></div>
                        </div>
                        <div class="form-group text-right">
                            <button type="button" id="button-filter" class="btn btn-default"><i
                                        class="fa fa-filter"></i> {{ button_filter }}</button>
                        </div>
                    </div>
                    <style>
                        /*修改订单列表页面筛选样式*/
                        .change-form .form-control {
                            display: inline-block;
                            width: auto;
                        }

                        .change-form .form-group {
                            display: inline-block;
                        }

                        .change-form .form-group .input-group {
                            display: inline-block;
                        }

                        .change-form .form-group .input-group-btn {
                            display: inline-block;
                            width: auto;
                        }
                    </style>
                </div>
            </div>

            <div class="col-sm-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><i class="fa fa-list"></i> {{ text_list }}</h3>
                    </div>
                    <div class="panel-body">
                        <form method="post" action="" enctype="multipart/form-data" id="form-order">
                            <div style="display: flex">
                                <div class="form-group" style="flex-shrink: 0;font-size: 14px;font-weight: bold;padding-right: 15px;">
                                    <label class="control-label"></label>
                                    <div>导出订单:</div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label" for="input-date-from">{{ '开始日期' }}</label>
                                    <div class="input-group date">
                                        <input type="text" name="filter_date_from" value="{{ filter_date_from }}"
                                               placeholder="{{ '开始日期' }}" data-date-format="YYYY-MM-DD" id="input-date-from"
                                               class="form-control"/>
                                        <span class="input-group-btn">
                <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
                </span></div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label" for="input-date-to">{{ '结束日期' }}</label>
                                    <div class="input-group date">
                                        <input type="text" name="filter_date_to" value="{{ filter_date_to }}"
                                               placeholder="{{ '结束日期' }}" data-date-format="YYYY-MM-DD" id="input-date-to"
                                               class="form-control"/>
                                        <span class="input-group-btn">
                <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
                </span></div>
                                </div>
                            </div>
                            <div style="display: flex">
                                <table class="table table-bordered table-hover" style="width: 210px;">
                                    <thead>
                                    <tr>
                                        <td style="width: 1px;" class="text-center"><input type="checkbox"
                                                                                           onclick="$('input[name*=\'selected\']').prop('checked', this.checked);"/>
                                        </td>
                                        <td class="" style="width: 180px;">操作</td>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {% if orders %}
                                        {% for order in orders %}
                                            <tr>
                                                <td class="text-center">
                                                    {% if order.order_id in selected %}
                                                        <input type="checkbox" name="selected[]"
                                                               value="{{ order.order_id }}" checked="checked"/>
                                                    {% else %}
                                                        <input type="checkbox" name="selected[]"
                                                               value="{{ order.order_id }}"/>
                                                    {% endif %}
                                                    <input type="hidden" name="shipping_code[]"
                                                           value="{{ order.shipping_code }}"/></td>
                                                <td class="order-operation" style="width: 180px!important;">
                                                    <div>
                                                        <select id="select{{ order.order_id }}">
                                                            {% for order_status in order_statuses %}
                                                                {% if order_status.order_status_id >=1 %}
                                                                    {% if order_status.name == order.order_status %}

                                                                        <option value="{{ order_status.order_status_id }}"
                                                                                selected="selected">{{ order_status.name }}</option>
                                                                    {% else %}
                                                                        <option value="{{ order_status.order_status_id }}">{{ order_status.name }}</option>
                                                                    {% endif %}
                                                                {% endif %}
                                                            {% endfor %}
                                                        </select>
                                                    </div>
                                                    <div>
                                                    <textarea id="textarea{{ order.order_id }}" cols="20" rows="2"
                                                              placeholder="请输入"></textarea>
                                                    </div>
                                                    <div class="button-box">
                                                        <input type="hidden" id="order_id{{ order.order_id }}"
                                                               value="{{ order.order_id }}">
                                                        <button type="button" class="green-btn submitBtn"
                                                                id="{{ order.order_id }}">确定
                                                        </button>
                                                        <a href="{{ order.edit }}" target="_blank"
                                                           class="green-btn">编辑订单</a>
                                                        {#<button type="button" class="blue-btn">更多操作</button>#}
                                                    </div>
                                                    <div>
                                                        <a href="{{ order.view }}" target="_blank">查看详情</a>
                                                        {#<a href="javascript:">取消订单</a>#}
                                                    </div>
                                                </td>
                                            </tr>
                                        {% endfor %}
                                    {% else %}
                                        <tr>
                                            <td class="text-center" colspan="8">{{ text_no_results }}</td>
                                        </tr>
                                    {% endif %}
                                    </tbody>

                                </table>
                                <div class="table-responsive">
                                    <table class="table table-bordered table-hover modal-table scroll-table">
                                        <thead>
                                        <tr>
                                            {#<td style="width: 1px;" class="text-center"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);" /></td>#}
                                            {#<td class="">操作</td>#}
                                            <td class="text-left">
                                                {% if sort == 'customer' %}
                                                    <a href="{{ sort_customer }}"
                                                       class="{{ order|lower }}">{{ column_customer }}</a>
                                                {% else %}
                                                    <a href="{{ sort_customer }}">{{ column_customer }}</a>
                                                {% endif %}
                                            </td>
                                            <td class="">电话</td>
                                            <td class="">邮箱</td>
                                            <td class="">地址</td>
                                            <td class="">备注</td>
                                            <td class="">订单id</td>
                                            <td class="">域名</td>
                                            {#<td class="">无效原因</td>#}
                                            <td class="">留言</td>
                                            <td class="text-left">
                                                {% if sort == 'o.order_id' %}
                                                    <a href="{{ sort_order }}" class="{{ order|lower }}">{{ column_order_id }}</a>
                                                {% else %}
                                                    <a href="{{ sort_order }}">{{ column_order_id }}</a>
                                                {% endif %}
                                            </td>
                                            <td class="text-left">
                                                {% if sort == 'order_status' %}
                                                    <a href="{{ sort_status }}" class="{{ order|lower }}">{{ column_status }}</a>
                                                {% else %}
                                                    <a href="{{ sort_status }}">{{ column_status }}</a>
                                                {% endif %}
                                            </td>
                                            <td class="text-left">
                                                {% if sort == 'o.total' %}
                                                    <a href="{{ sort_total }}" class="{{ order|lower }}">{{ column_total }}</a>
                                                {% else %}
                                                    <a href="{{ sort_total }}">{{ column_total }}</a>
                                                {% endif %}
                                            </td>
                                            <td class="text-left">
                                                {% if sort == 'o.date_added' %}
                                                    <a href="{{ sort_date_added }}" class="{{ order|lower }}">{{ column_date_added }}</a>
                                                {% else %}
                                                    <a href="{{ sort_date_added }}">{{ column_date_added }}</a>
                                                {% endif %}
                                            </td>
                                            <td class="text-left">
                                                {% if sort == 'o.date_modified' %}
                                                    <a href="{{ sort_date_modified }}" class="{{ order|lower }}">{{ column_date_modified }}</a>
                                                {% else %}
                                                    <a href="{{ sort_date_modified }}">{{ column_date_modified }}</a>
                                                {% endif %}
                                            </td>
                                            <td class="text-left">{{ column_action }}</td>
                                        </tr>
                                        </thead>
                                        <tbody>

                                        {% if orders %}
                                            {% for order in orders %}
                                                <tr>
                                                    <td class="text-left" style="min-width: 100px;">{{ order.customer }}</td>
                                                    <td class="text-left" onclick="showMoreOrderClick(this);" data-key="telephone" style="cursor: pointer" data-toggle="modal" data-target="#showMoreOrder"><div class="numberData">{{ order.telephone }}</div>{{ order.blacktelephone }}</td>
                                                    <td class="text-left" onclick="showMoreOrderClick(this);" data-key="email" style="cursor: pointer" data-toggle="modal" data-target="#showMoreOrder"><div class="numberData">{{ order.email }}</div></td>
                                                    <td class="text-left change-width " style="word-break: break-all">
                                                        {% if order.payment_zone %}
                                                            <div>
                                                                {{ order.payment_country }}
                                                            </div>
                                                            <div>
                                                                {{ order.payment_zone }}
                                                            </div>
                                                        {% endif %}
                                                        <div>
                                                            {{ order.payment_address_1 }}
                                                        </div>
                                                    </td>
                                                    <td class="text-left change-width break-line" style="word-break: break-all">{{ order.remark }}</td>
                                                    <td class="text-left change-width">
                                                        <div>
                                                            {{ order.order_id }}
                                                        </div>
                                                        <div style="white-space:nowrap;">
                                                            {{ order.ip }}
                                                        </div>
                                                        {% if order.repeataddval %}
                                                            <div style="color: red; white-space:nowrap;">{{ order.repeataddval }}</div>
                                                        {% endif %}
                                                        <div class="btn-group">
                                                            <button class="add-black-list" style="background-color: #009789;color: #FFFFFF;border: none;" type="button" ip="{{ order.ip_o }}" telephone="{{ order.telephone_o }}"> {{ '加入黑名单' }}</button>
                                                        </div>


                                                        {#</div>#}


                                                    </td>
                                                    <td class="text-left">
                                                        <div>
                                                            {{ order.payment_country }}
                                                        </div>
                                                        <div>
                                                            {{ order.store_url }}
                                                        </div>

                                                    </td>
                                                    {#<td class="text-left" style="min-width: 100px;">{{ order.cause_invalidity_name }}</td>#}


                                                    <td class="text-left change-width break-line">{{ order.comment }}</td>
                                                    <td class="text-left" style="min-width: 100px;">{{ order.order_id }}</td>

                                                    <td class="text-left">{{ order.order_status }}</td>
                                                    <td class="text-left">{{ order.total }}</td>
                                                    <td class="text-left">{{ order.date_added }}</td>
                                                    <td class="text-left">{{ order.date_modified }}</td>
                                                    <td class="text-left">
                                                        <div style="min-width: 120px;">
                                                            <div class="btn-group"><a href="{{ order.view }}" target="_blank"
                                                                                      data-toggle="tooltip" title="{{ button_view }}"
                                                                                      class="btn btn-primary"><i class="fa fa-eye"></i></a>
                                                                <button type="button" data-toggle="dropdown"
                                                                        class="btn btn-primary dropdown-toggle"><span class="caret"></span>
                                                                </button>
                                                                <ul class="dropdown-menu dropdown-menu-right">
                                                                    <li><a href="{{ order.edit }}" target="_blank"><i
                                                                                    class="fa fa-pencil"></i> {{ button_edit }}</a></li>
                                                                    <li><a href="{{ order.order_id }}"><i
                                                                                    class="fa fa-trash-o"></i> {{ button_delete }}</a></li>
                                                                </ul>
                                                            </div>
                                                        </div>
                                                    </td>
                                                </tr>
                                            {% endfor %}
                                        {% else %}
                                            <tr>
                                                <td class="text-center" colspan="8">{{ text_no_results }}</td>
                                            </tr>
                                        {% endif %}
                                        </tbody>

                                    </table>
                                    <style>
                                        .modal-table .change-width {
                                            min-width: 150px;
                                            max-width: 250px;
                                        }

                                        .scroll-table tbody td {
                                            height: 155px;
                                        }

                                        .scroll-table thead td {
                                            white-space: nowrap;
                                        }

                                        .break-line {
                                            word-break: break-all !important;
                                            white-space: pre-line !important;
                                        }

                                        @media screen and (max-width: 767px) {
                                            .break-line {
                                                word-break: break-all !important;
                                                white-space: pre-line !important;
                                            }
                                        }
                                    </style>
                                </div>
                            </div>
                    </form>
                    <div class="row">
                        <div class="col-sm-6 text-left">{{ pagination }}</div>
                        <div class="col-sm-6 text-right">{{ results }}</div>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <div class="modal fade" id="showMoreOrder" tabindex="-1" aria-labelledby="myModalLabel">
        <div class="modal-dialog" style="width: 90%;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                    <h4 class="modal-title" id="myModalLabel">Modal title</h4>
                </div>
                <div class="modal-body">
                    <div class="table-responsive">
                        <p>loading...</p>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    {#<button type="button" class="btn btn-primary">Save</button>#}
                </div>
            </div>
        </div>
    </div>
    <script>
        // 点击电话号码
        function showMoreOrderClick(_this) {
            var url = '/admin/index.php?route=sale/order/getclickoeders&user_token={{ user_token }}';
            $.ajax({
                url: url + '&' + _this.dataset.key + '=' + $(_this).children('.numberData').text(),
                success: function (html) {
                    $('#showMoreOrder .table-responsive').html(html);
                }
            })
        }
    </script>
    <script type="text/javascript"><!--
        $('#button-filter').on('click', function () {
            url = '';

            var filter_order_id = $('input[name=\'filter_order_id\']').val();

            if (filter_order_id) {
                url += '&filter_order_id=' + encodeURIComponent(filter_order_id);
            }

            var filter_customer = $('input[name=\'filter_customer\']').val();

            if (filter_customer) {
                url += '&filter_customer=' + encodeURIComponent(filter_customer);
            }

            var filter_order_status_id = $('select[name=\'filter_order_status_id\']').val();

            if (filter_order_status_id !== '') {
                url += '&filter_order_status_id=' + encodeURIComponent(filter_order_status_id);
            }

            var filter_total = $('input[name=\'filter_total\']').val();

            if (filter_total) {
                url += '&filter_total=' + encodeURIComponent(filter_total);
            }

            var telephone = $('input[name=\'telephone\']').val();

            if (telephone) {
                url += '&telephone=' + encodeURIComponent(telephone);
            }

            var filter_date_added = $('input[name=\'filter_date_added\']').val();

            if (filter_date_added) {
                url += '&filter_date_added=' + encodeURIComponent(filter_date_added);
            }

            var filter_date_modified = $('input[name=\'filter_date_modified\']').val();

            if (filter_date_modified) {
                url += '&filter_date_modified=' + encodeURIComponent(filter_date_modified);
            }

            location = 'index.php?route=sale/order&user_token={{ user_token }}' + url;
        });
        //--></script>
    <script type="text/javascript"><!--
        $('input[name=\'filter_customer\']').autocomplete({
            'source': function (request, response) {
                $.ajax({
                    url: 'index.php?route=customer/customer/autocomplete&user_token={{ user_token }}&filter_name=' + encodeURIComponent(request),
                    dataType: 'json',
                    success: function (json) {
                        response($.map(json, function (item) {
                            return {
                                label: item['name'],
                                value: item['customer_id']
                            }
                        }));
                    }
                });
            },
            'select': function (item) {
                $('input[name=\'filter_customer\']').val(item['label']);
            }
        });
        //--></script>
    <script type="text/javascript"><!--
        $('input[name^=\'selected\']').on('change', function () {
            $('#button-shipping, #button-invoice, #button-export').prop('disabled', true);

            var selected = $('input[name^=\'selected\']:checked');

            if (selected.length) {
                $('#button-invoice, #button-export').prop('disabled', false);
            }

            for (i = 0; i < selected.length; i++) {
                if ($(selected[i]).parent().find('input[name^=\'shipping_code\']').val()) {
                    $('#button-shipping').prop('disabled', false);

                    break;
                }
            }
        });

        $('#button-shipping, #button-invoice, #button-export').prop('disabled', true);

        $('input[name^=\'selected\']:first').trigger('change');

        // IE and Edge fix!
        $('#button-shipping, #button-invoice').on('click', function (e) {
            $('#form-order').attr('action', this.getAttribute('formAction'));
        });

        $('#button-export').on('click', function (e) {
            $('#form-order').attr('action', this.getAttribute('formAction'));
        });

        $('#form-order li:last-child a').on('click', function (e) {
            e.preventDefault();

            var element = this;

            if (confirm('{{ text_confirm }}')) {
                $.ajax({
                    url: '{{ catalog }}index.php?route=api/order/delete&api_token={{ api_token }}&store_id={{ store_id }}&order_id=' + $(element).attr('href'),
                    dataType: 'json',
                    beforeSend: function () {
                        $(element).parent().parent().parent().find('button').button('loading');
                    },
                    complete: function () {
                        $(element).parent().parent().parent().find('button').button('reset');
                    },
                    success: function (json) {
                        $('.alert-dismissible').remove();

                        if (json['error']) {
                            $('#content > .container-fluid').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');
                        }

                        if (json['success']) {
                            location = '{{ delete }}';
                        }
                    },
                    error: function (xhr, ajaxOptions, thrownError) {
                        alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
                    }
                });
            }
        });

        $('.add-black-list').on('click', function (e) {
            e.preventDefault();

            var element = this;
            var data = {};
            data['ip'] = $(this).attr('ip');
            data['telephone'] = $(this).attr('telephone');
            if (confirm('{{ text_confirm }}')) {
                $.ajax({
                    url: 'index.php?route=sale/order/setbacklist&user_token={{ user_token }}&store_id={{ store_id }}',
                    dataType: 'json',
                    type: 'POST',
                    data: data,
                    beforeSend: function () {
                        $(element).parent().parent().parent().find('button').button('loading');
                    },
                    complete: function () {
                        $(element).parent().parent().parent().find('button').button('reset');
                    },
                    success: function (json) {
                        $('.alert-dismissible').remove();

                        if (json['error']) {
                            alert(json['error']);
                            history.go(0);
                        }

                        if (json['success']) {
                            alert('添加成功');
                            history.go(0);
                        }
                    },
                    error: function (xhr, ajaxOptions, thrownError) {
                        alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
                    }
                });
            }
        });
        //--></script>
    <script src="view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
    <link href="view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.css" type="text/css" rel="stylesheet"
          media="screen"/>
    <script type="text/javascript"><!--
        $('.date').datetimepicker({
            language: '{{ datepicker }}',
            pickTime: false
        });
        //--></script>
</div>
<script>
    $('.submitBtn').on('click', function () {
        $(this).attr('disabled', true);
        var id = $(this).attr('id');
        var data = {};
        data['select'] = $('#select' + $(this).attr('id')).val();
        data['textarea'] = $('#textarea' + $(this).attr('id')).val();
        data['order_id'] = $('#order_id' + $(this).attr('id')).val();
        var _this = $(this);
        var url = '{{ catalog }}index.php?route=api/order/editboard&api_token={{ api_token }}&store_id={{ store_id }}';
        $.ajax({
            url: url,
            type: 'POST',
            data: data,
            success: function (res) {
                if (res['success']) {
                    location = 'index.php?route=sale/order&user_token={{ user_token }}{{ pages }}';
                }
            },
            error: function (res) {
                console.log('提交失败');
                console.log(res.status);
                _this.attr('disabled', false);
            }
        })
    })

</script>
{{ footer }}